<%@include file="/WEB-INF/templates/configuration.jsp" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<style>

</style>

<h2>Chapters</h2>
<c:choose>
    <c:when test="${amountassignments != 0}">
        <!-- Wanneer er gebruikers opgeslagen zijn, worden ze hier getoond -->
        <table class="zebra">
            <tr>
                <th style="width:100px"> 
                    <strong>Assignment Name</strong>
                </th>
                <th style="width:300px">
                    <strong>Assignment Question</strong>
                </th>
            </tr>
            <c:forEach var="tempAssignment" items="${assignments}">
                <!-- Per gebruiker wordt nu een rij aangemaakt met daarin zijn gegevens -->
                <tr>
                    <td style="width:300px">
                        <div class="description">${tempAssignment.assignmentquestion}</div>
                    </td>
                    <td>
                        <% String box = "";%>
                        <ul class="questions">
                            <c:forEach var="tempAnswer" items="${tempAssignment.assignmentsanswer}">

                            <c:choose>
                                <c:when test="${tempAssignment.assignmenttype == 0}">
                                    <% box = "checkbox";%>
                                </c:when>
                                <c:otherwise>
                                    <% box = "radio";%>
                                </c:otherwise>
                            </c:choose>

                                <li><input class=answer-radio style=width:auto type=<%=box%> name=answerid value="${tempAnswer.answerid}" />${tempAnswer.answername}</li>
                        </c:forEach>
                        </ul>
                    </td>
                </tr>     
            </c:forEach>
        </table>
    </c:when>
    <c:otherwise>
        <!-- Als er geen cursussen zijn, wordt deze melding getoond -->
        There are no chapters found.
    </c:otherwise>
</c:choose>
<p>
    <a href="${url}index">Back to index</a>
</p>